#ifndef SPECPARAMDESIGNMODEL_H
#define SPECPARAMDESIGNMODEL_H

#include <QAbstractTableModel>

#include "specdesign.h"
#include "specdesignl.h"

class SpecDesignModel : public QAbstractTableModel
{
public:
    Q_OBJECT
public:
    SpecDesignModel(SpecDesignL* ptr_sp_list, QObject *parent = 0) ;

    // Obbligatorio per modello sola lettura
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;

    // Obbligatorio per modello resizeble. QModelIndex non serve nel caso di tabelle
    bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());
    bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());

    // Obbligatorio per modello editabile
    bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole);

    // Per aggiornare la vista quando il modello cambia (WhenExternalDataChange)
    void updateWEDChange(void);
private:
    SpecDesignL* m_sp_list;
};

#endif // SPECPARAMDESIGNMODEL_H
